import tkinter
root = tkinter.Tk()
text = tkinter.Text(root,width=20,height=15)
text.pack()
photo = tkinter.PhotoImage(file=r'C:\Users\Administrator\Desktop\22.gif')
def show():
    print('点了一下')
    text.image_create('end',image=photo)
    print(text.get("1.2", 1.6))
    text.insert('end', 'i am djy')
b1 = tkinter.Button(text,text='点我',command=show)
text.window_create('insert',window=b1)
root.mainloop()